-
-
Notifications
You must be signed in to change notification settings - Fork 997
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WINTERMUTE: Add keymappings #2051
Conversation
engines/wintermute/detection.cpp
Outdated
|
||
Common::KeymapArray result = Keymap::arrayOf(engineKeyMap); | ||
|
||
Common::String targetString = target; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The target is user-controlled. It's possible to edit it when adding a game. Is fetching the gameid from the configuration manager not working for you? Common::String gameId = ConfMan.get("gameid", target);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Never noticed "gameid" property before.
9a02972
to
97b71a3
Compare
c9f982a
to
0586e42
Compare
Current state of this PR:
|
Humongous work! We can merge this whenever you feel it's ready.
I'll look into fixing that, there is no reason not to be able to remap the modifier keys. |
Thanks! I guess I'll wait for #2052 to complete and will do a rebase, since my branch conflicts with that PR. Meanwhile, current open questions:
|
At the moment, joystick button combos are not expressible using the keymapper. I suggest leaving those actions unmapped with a comment describing the ideal bindings. Users can map them to device specific buttons (triggers, stick press, right stick axes) if needed. |
Done in 29dd15a. |
engines/wintermute/detection.cpp
Outdated
act = new Action("RETURN", _("Confirm")); | ||
act->setKeyEvent(KeyState(KEYCODE_RETURN, ASCII_RETURN)); | ||
act->addDefaultInputMapping("RETURN"); // original keyboard | ||
//TODO: extra joy control, e.g. "JOY_R+JOY_X" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, indent all of these TODO comments properly (more follow below, no reason to repeat this comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Intended in line with code with tabs.
Extraordinary work! Well done! Could you please fix the indentation of the TODO comments? Other than that, it's an amazing effort, kudos! |
Those 4 keys are enough to complete most game: https://wiki.scummvm.org/index.php?title=Wintermute/Controls
0586e42
to
9e267aa
Compare
Rebased, removed debugger handling (it's already done at #2052), added Shift hotkey for One Helluva Day demo, moved TODOs to the right.
Thanks, supported that at 9e267aa.
Fixed at 9e267aa.
I feel it's ready. |
engines/wintermute/detection.cpp
Outdated
gameId == "rhiannon" || | ||
gameId == "shinestar" | ||
) { | ||
act = new Action("SKIP", _("Skip")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
act = new Action("SKIP", _("Skip")); | |
act = new Action(kStandardActionSkip, _("Skip")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, fixed! Maybe we should also introduce more Standard Actions for things like "HINT", "WTF", "ACTNXT", "PAGEDN", "SCRLUP", etc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, feel free to add some. I'm not convinced standard actions are very useful at the moment. We set the default bindings for mouse+keyboard and gamepad when we define the actions. The backend changing the defaults for the standard actions is very likely to result in nonsensical / conflicting keymaps.
One possible future change is the evolution of the virtual keyboard into some sort of more general touch oriented on-screen input method. Having standard actions in that context would be nice as we could bundle a set of corresponding icons.
engines/wintermute/detection.cpp
Outdated
//TODO: extra joy control, e.g. "JOY_R+JOY_B" | ||
gameKeyMap->addAction(act); | ||
|
||
act = new Action("DBG", _("Debug print")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has the same ID as the action for opening the debugger. I suggest renaming it to something else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed to "DBGTXT", thanks for pointing this.
@bluegr @ccawley2011 @bgK Should we introduce some convention to avoid things like this in the future? Like, "non-standard actions IDs should always be 6+ characters long"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well the action ids are namespaced by the keymap names. There was no real conflict here. The only issue is if a backend sets a default for a standard action that happens to have the same name as game action. I'm not sure it's worth the effort of enforcing a naming convention just for that.
Fixed errors from above + splited "5ma||5ld||dirtysplit||projectjoe" keymap into two, since they slightly different original controls + fixed action ID collision at Alpha Polaris. |
Great work, once again! Thanks for fixing the pending issues. Merging |
No description provided.